<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>入党申请</title>
    <meta name="keywords" content="入党申请" />
    <meta name="description" content="入党申请" />
    <link href="/static/css/party/style.css" rel="stylesheet" type="text/css">
    <link href="/static/js/party/myfocus/js/mf-pattern/mF_classicHC.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/static/webjars/layui/css/layui.css"  media="all">
    <script type="application/javascript" src="/static/webjars/layui/layui.all.js"></script>
    <script type="application/javascript" src="/static/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/css/party/foot.css"/>

    <link href="/static/css/party/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="/static/css/party/common.css" rel="stylesheet" type="text/css">
    <link href="/static/css/party/common2018.css.css" rel="stylesheet" type="text/css">
    <link href="/static/css/party/iconfont.css" rel="stylesheet" type="text/css">

    <link href="/static/css/party/font-awesome.min.css" rel="stylesheet" type="text/css">
    <script type="application/javascript" src="/static/js/party/template-web.js"></script>
    <script type="application/javascript" src="/static/js/party/template-web-extends.js"></script>
    <script type="application/javascript" src="/static/js/party/boorstap.min.js"></script>
    <script type="application/javascript" src="/static/js/party/common.js"></script>
    <style>
        body{
            background-color: #DEEAEA;
        }

    </style>

    <script type="application/javascript">
        var form = layui.form;
        $.post("/ajax/party/nations",{
            check:1024
        },function (res) {
            if(res.code==0){
                //得到所有级别
                var names = new Array();
                for(var i=0;i<res.data.length;i++){
                    names[i]=res.data[i].name;
                }
                //将等级动态显示到界面上
                for(var i=0;i<names.length;i++){
                    document.getElementById("nation").options.add(new Option(names[i],names[i]));
                }

            }
            else{
                layer.alert("未知错误！");
            }
            form.render();
        })

        $.post("/ajax/party/education_degree",{
            check:1024
        },function (res) {
            if(res.code==0){
                //得到所有级别
                var names = new Array();
                for(var i=0;i<res.data.length;i++){
                    names[i]=res.data[i].name;
                }
                //将等级动态显示到界面上
                for(var i=0;i<names.length;i++){
                    document.getElementById("education").options.add(new Option(names[i],names[i]));
                }

            }
            else{
                layer.alert("未知错误！");
            }
            form.render();
        })

        $.post("/ajax/party/occupations",{
            check:1024
        },function (res) {
            if(res.code==0){
                //得到所有级别
                var names = new Array();
                for(var i=0;i<res.data.length;i++){
                    names[i]=res.data[i].name;
                }
                //将等级动态显示到界面上
                for(var i=0;i<names.length;i++){
                    document.getElementById("occupation").options.add(new Option(names[i],names[i]));
                }

            }
            else{
                layer.alert("未知错误！");
            }
            form.render();
        })

        $.post("/ajax/party/industrys",{
            check:1024
        },function (res) {
            if(res.code==0){
                //得到所有级别
                var names = new Array();
                for(var i=0;i<res.data.length;i++){
                    names[i]=res.data[i].name;
                }
                //将等级动态显示到界面上
                for(var i=0;i<names.length;i++){
                    document.getElementById("industry").options.add(new Option(names[i],names[i]));
                }

            }
            else{
                layer.alert("未知错误！");
            }
            form.render();
        })


    </script>
</head>
<body>
<div class="padlogo w1200 mt50">
    <div class="danghui fl ml25"><img src="/static/images/party/img/danghui.gif"/></div>
    <div class="logo fl ml20 mt8"><img src="/static/images/party/img/logo.png"/></div>
    <div class="slogo fr"><embed src="/static/images/party/img/donghua.swf" width="600" height="150" wmode="transparent" /></div>
    <div class="clear"></div>
</div>

<div class="w1000 mt60" >
    <ul class="nav" style="text-align: center" id="dingbu">
        <li class="bg2">&nbsp;</li>
        <li class="bg2" style="width: 143px;" party-src="/party/home/index"><a href="javascript:;">首页</a></li>
        <li class="bg2" style="width: 143px" party-src="/party/home/news"><a href="javascript:;">新闻资讯</a></li>
        <li class="bg2" style="width: 143px" party-src="/party/home/education"><a href="javascript:;">教育培训</a></li>
        <li class="bg2" style="width: 143px" party-src="/party/home/service"><a href="javascript:;">服务大厅</a></li>
        <li class="bg2" style="width: 143px" party-src="/party/home/map"><a href="javascript:;">党建地图</a></li>
        <li class="bg2" style="width: 143px"><a href="/party/home/admin" target="_blank">后台管理</a></li>

        <%--<li class="bg2"><a href='/views/party/fore/index1.jsp' target='_blank'>后台管理</a></li>--%>
    </ul>

</div>
<div class='nav_bg w1000 mt30'><img src='/static/images/party/img/nav_bg.png' class='tcenter'/></div>

<div class="clearfix"></div>

<div class="container">

    <div class="row">
        <div class="col-sm-12"> <img src="/static/images/party/img/banner05.png"></div>
    </div>
    <div class="row">
        <%--<img src="/static/images/party/img/fwdt-icon01.png" style="margin-right: 10px; margin-bottom: 5px;">--%>
        <div class="col-sm-6"><h4 class="service-red-border" style="color: #CC0000">入党申请</h4></div>
        <div class="col-sm-6 text-right" style=" margin-top:30px; padding-right: 20px;"><small>请认真填写必填项</small></div>
    </div>
    <form id="form_rdsq" class="layui-form">
        <div class="row" style="background-color: #F5F5F5; padding: -10px 10px 10px 10px;">
            <div class="col-sm-6" style="background-color: #DEEAEA; height: 510px;">
                <div class="form-group">
                    <h5 style="color: #F64C4C;line-height: 40px;padding-left: 20px; font-size: 16px;">基本信息</h5>
                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>姓名：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg"  name="name" placeholder="请输入姓名" maxlength="20" minlength="2" />
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>性别：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <label class="radio-inline">
                            <input type="radio" name="sex" id="optionsRadios3" class="sex" value="1" checked="checked"> 男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="sex" id="optionsRadios4" class="sex" value="0"> 女
                        </label>
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>籍贯：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" placeholder="请输入籍贯" name="birthPlace" maxlength="20" minlength="1">
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>现居地：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" name="livePlace" placeholder="请输入现居地" maxlength="50" minlength="1">
                    </div>


                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>民族：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <div class="layui-inline" style="width: 100%;">
                            <div class="layui-input-inline" style="width: 100%;">
                                <select id="nation" name="nation" lay-verify="required" lay-search="" style="width: 100%;">

                                </select>
                            </div>
                        </div>

                        <%--<select class="form-control" id="nation"></select>--%>
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>手机号码：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" name="tellphone" placeholder="请输入手机号码" maxlength="11" />
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>身份证号：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" name="idCard" placeholder="请输入身份证号" maxlength="18">
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>头像：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <div class="layui-input-block">
                            <button style="margin-left: -111px;" type="button" class="layui-btn" id="uploadImgBtn">上传头像</button>
                            <div class="layui-upload-list" style="margin-top: -47px;">
                                <img class="layui-upload-img" style="height: 50px;" id="uploadImg"/>
                                <p id="uploadImgText"></p>
                            </div>
                            <input type="hidden" name="icon" value="" required/>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-sm-6" style="background-color: #DEEAEA; height: 510px;">
                <div class="form-group">
                    <h5 style="color: #F64C4C;line-height: 40px;padding-left: 20px; font-size: 16px;">入党信息</h5>
                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>入党党支部：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" id="UnitName" name="branch" placeholder="请输入入党党支部" class="form-control"  />
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>学历：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <div class="layui-inline" style="width: 100%;">
                            <div class="layui-input-inline" style="width: 100%;">
                                <select id="education" name="education" lay-verify="required" lay-search="" style="width: 100%;">

                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>毕业院校：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" name="school" placeholder="请输入毕业院校" maxlength="20">
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>职业：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">

                        <div class="layui-inline" style="width: 100%;">
                            <div class="layui-input-inline" style="width: 100%;">
                                <select id="occupation" name="occupation" lay-verify="required" lay-search="" style="width: 100%;">

                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>所属行业：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <div class="layui-inline" style="width: 100%;">
                            <div class="layui-input-inline" style="width: 100%;">
                                <select id="industry" name="industry" lay-verify="required" lay-search="" style="width: 100%;">

                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>特长介绍：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" name="introduce" placeholder="请输入特长介绍" maxlength="50">
                    </div>


                    <div class="col-sm-3 text-right" style="line-height: 35px;"><label>入党申请书：</label> </div>
                    <div class="col-sm-9 " style="margin-bottom: 20px;">
                        <input type="text" class="form-control form-control-bg" id="applicationFormFile"  name="applyBook"  placeholder="点击上传">
                    </div>
                </div>

            </div>

            <div class="col-sm-12 text-center" style=";background-color: #DEEAEA;padding: 30px;">
                <button type="button" class="btn btn-danger btn-default" style="margin-right: 20px;" id="submit"> 提 交 </button>
                <button type="button" class="btn btn-danger btn-default" onclick="reset()"> 重 置 </button>
            </div>
        </div>
    </form>

</div>


<div id="ft" class="clearfix">
    <div class="ft-center">
        <span>智慧兴文公共信息平台:&nbsp;</span>
        <a>All Rights Reserved.&nbsp;&nbsp;</a>
        <span>版权所有:&nbsp;</span>
        <a href="http://www.ituohui.com/" target="_blank">四川省数聚汇智科技有限公司</a>
    </div>
</div>



</body>
</html>
<script type="application/javascript">
    var nowTime = new Date().getTime();
    $("li[party-src]").click(function(){
        var that = $(this);
        var src = that.attr("party-src");
        window.location.href = src;
    });
</script>


<script type="application/javascript">

        layui.use('upload',function () {
            var upload = layui.upload;

            //执行实例
            var uploadInst = upload.render({
                elem:'#uploadImgBtn'  //绑定元素
                ,url:'/api/spfile/upload'  //上传接口
                ,data:{
                    tableName: '入党申请表',
                    index:nowTime
                }
                ,before: function(obj){
                    obj.preview(function(index, file, result){
                        console.log(result);
                        $('#uploadImg').attr('src', result);
                    });
                }
                ,done:function (res) {
                    $("input[name=icon]").val(res.url);
                }
                ,error:function () {
                    alert("nono");
                }
            });

            nowTime = new Date().getTime();

            var uploadInst = upload.render({
                elem:'#applicationFormFile'  //绑定元素
                ,url:'/api/spfile/upload'  //上传接口
                ,accept:'file'
                ,data:{
                    tableName: '入党申请表',
                    index:nowTime
                }
                ,done:function (res) {
                    $("input[name=applyBook]").val(res.url);
                     console.log(res);
                }
                ,error:function () {
                    alert("nono");
                }
            });




        })


</script>

<script type="application/javascript">

    $("#submit").click(function () {
        var params = $("#form_rdsq").serializeObject();
        params.time = nowTime;
        console.log(params);
        $.ajax({
            type:"post",
            url:"/ajax/party/applyparty",
            data:params,
            success:function (res) {
                if(res.code==0){
                    layer.alert("提交成功！");
                    nowTime = new Date().getTime();
                    console.log(nowTime);
                }
            }
        })
    })

</script>